<template>
  <div class="addBtn">
    <el-button type="primary" @click="buttonAdd">{{ btnName }}</el-button>
  </div>
</template>

<script lang="ts">
export default {
  name: "AddButton",
  props: {
    btnName: {
      type: String,
      default: () => "添加",
    },
  },
  setup(props, { emit }) {
    //触发添加按钮
    function buttonAdd() {
      emit("buttonAdd", null);
    }
    return {
      buttonAdd,
    };
  },
};
</script>

<style scoped>
.addBtn {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  float: right;
  width: 10%;
  height: 50px;
}
</style>